import Vue from 'vue'
import App from './App.vue'
import router, { createRouter } from './router'
import store from './store'

import Ui from './ui'

import './library'
import './plugin'

Vue.config.productionTip = false
Vue.config.warnHandler = (msg, vm, trace) => {
  if (msg.indexOf('(Promise/async)') === -1) {
    console.warn(msg)
  }
}

Vue.use(Ui)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

export const createApp = function () {
  const router = new createRouter()
  const app = new Vue({
    router,
    render: h => h(App)
  })
  return { app, router }
}
